<html>
{loadres="./res/html/common/head.html"}
    <div class="container" id="content">
        <div style="text-align:center;">
        <div id="img">{$headimg}</div>
        <p><h2>{$flags}<a href="./index?do=changenickname">{$nickname}</a></h2><a href="./message">消息({$msgcount})</a></p>
        <p>上次登陆:{$lastlogintime}</p>
        <p>经验:{$money}</p>
        <p>邮箱:{$email}</p>
        <a class="btn btn-primary btn-lg btn-block waves-effect" href="./index?do=changeemail">修改邮箱</a>
        <a class="btn btn-primary btn-lg btn-block waves-effect" href="./index?do=changepw">修改密码</a>
        <a class="btn btn-primary btn-lg btn-block waves-effect" href="./index?do=manage">社区存档管理</a>
        <a class="btn btn-primary btn-lg btn-block waves-effect" href="{$WEBPATH}/mods/list" >Mods发布管理</a>
        {::isAdmin}<a class="btn btn-primary btn-warning btn-lg btn-block waves-effect" href="./index?do=manageadmin">社区存档管理后台</a>{/isAdmin}
        {::isAdmin}<a class="btn btn-primary btn-warning btn-lg btn-block waves-effect" href="{$WEBPATH}/admin/index">网站管理后台</a>{/isAdmin}
        </div>
    </div>
{loadres="./res/html/common/foot.html"}
<!--加载layui组件-->
<script src="/com/res/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;
  
  //普通图片上传
  var uploadInst = upload.render({
    elem: '#img'
    ,url: '/com/userupload'
    ,acceptMime: 'image/jpg, image/png'
    ,before: function(obj){
      obj.preview(function(index, file, result){
      });
    }
    ,done: function(res){
      if(res.code != 200){
        return layer.msg('上传失败');
      }else{
         $("[id=usericon]").attr('src',res.data);
          return layer.msg('更改成功');
      }
    }
    ,error: function(){
    }
  });
    });
</script>
    </html>